package com.zhenquan.hive;

import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;

public class Max  extends UDF {
    private Text result=new Text();
    //自定义方法
    public Text evaluate(Text str)
    {
        if(str==null)
            return null;
        result.set(StringUtils.strip(str.toString()));
        return result;
    }
    public Text evaluate(Text str,String stripChars)
    {
        if(str==null)
            return null;
        result.set(StringUtils.strip(str.toString(),stripChars));
        return result;
    }
}
